#ifndef AVALON_MOCKCONNECTION_HPP
#define AVALON_MOCKCONNECTION_HPP
#pragma warning(disable : 4267)
#include <boost/thread.hpp>
#pragma warning(default : 4267)
#include "Avalon/IO/Connection.hpp"
#include "Avalon/IOTests/IOTests.hpp"

namespace Avalon {
namespace IO {
namespace Tests {

  /** \class MockConnection
   *  \brief Implements Connection for testing/mock purposes.
   *  \author Kamal Mansouri <kranar@hotmail.com>
   */
  class MockConnection : public Connection {
    public:

      //! Constructs a MockConnection.
      MockConnection();

      virtual ~MockConnection();

      //! Sets this MockConnection as Connected.
      void SetConnected();

      virtual bool IsConnected();

      virtual void Close();

      virtual boost::signals2::connection ConnectClosedSignal(
        const ClosedSignal::slot_type& slot);

      virtual boost::signals2::connection ConnectClosedSignal(
        const ClosedSignal::slot_type& slot, bool* isConnected);

    private:
      boost::mutex m_mutex;
      bool m_isConnected;
      ClosedSignal m_closedSignal;
  };
}
}
}

#endif // AVALON_MOCKCONNECTION_HPP
